package com.landeqing.service.impl;

import com.landeqing.dao.impl.StudentDaoImpl;
import com.landeqing.model.Student;
import com.landeqing.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("aaaService")
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDaoImpl studentDao;

//    public  StudentServiceImpl(){}
//    public StudentServiceImpl(StudentDao studentDao) {
//        this.studentDao = studentDao;
//    }


    public StudentDaoImpl getStudentDao() {
        return studentDao;
    }

    public void setStudentDao(StudentDaoImpl studentDao) {
        this.studentDao = studentDao;
    }

    public boolean insert(Student student) {
        return studentDao.insert(student);
    }

    public List<Student> findAll(int pageNo,int pageSize) {
        return studentDao.findAll(pageNo,pageSize);
    }

    public Student getById(Integer id) {
        return studentDao.getById(id);
    }

    public int getTotalCount() {
        return studentDao.getTotalCount();
    }
}
